import { App } from 'vue';
import { IBizOdooChat } from './common';
import { odooChatUtil } from './odoo-chat-util';
import UIAction from './ui-action';

declare module '@ibiz-template/core' {
  interface IBizSys {
    /**
     * @description odoo聊天工具类
     * @type {typeof odooChatUtil}
     * @memberof IBizSys
     */
    odooChatUtil: typeof odooChatUtil;
  }
}

export default {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
  install(app: App) {
    app.use(IBizOdooChat);
    app.use(UIAction);
    if (!ibiz.odooChatUtil) ibiz.odooChatUtil = odooChatUtil;
  },
};
